<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位</title>
  <style>
    .father {
      width: 80vw;
      height: 50vw;
      border: 1px solid #000;
      /* position: relative; 开启后子元素默认以父组件为标准 */
      position: relative;
      left: 10vw;
    }

    .one {
      width: 20vw;
      height: 10vw;
      background-color: orange;
      /* 开启定位后，元素不占位，后面的内容会上去 */
      /* position: absolute; 开启后默认以页面为标准 */
      position: absolute;
      left: 30vw;
      top: 20vw;
      /* 显示层级 */
      z-index: 2;
    }

    .two {
      width: 20vw;
      height: 10vw;
      background-color: green;
      position: absolute;
      left: 35vw;
      top: 25vw;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="one">one</div>
    <div class="two">two</div>
  </div>
</body>
</html>